package lanQiao;

//This program is to test the exam date
public class Fibonacci
{
	public static void main(String[] args)
	{
		int[] n = new int[2];
		n[0]=n[1]=1;
		
		int i=new java.util.Scanner(System.in).nextInt();
		
//		if(i>100000)
//			return;
		
		int j=0;
			
		for(;i-->2;)
		{
			j=1-j;
			n[j] = (n[0]+n[1])%10007;
		}

		System.out.println(n[j]);
	}
}
